import React from 'react';

import { type TextProps, Text } from '@mantine/core';
import classNames from 'classnames';
import styles from './Text.module.less';
import { mergeClassNames } from '../tools';

interface ExtendedTextProps extends TextProps {
  children: React.ReactNode;
  fm?: number;
}
export const NText = React.memo(({ className, children, fm = 0, size = 'md', ...restProps }: ExtendedTextProps) => {
  {
    return (
      <Text
        className={classNames(styles['fm-' + fm], className)}
        classNames={mergeClassNames(styles, restProps.classNames)}
        size={size}
        {...restProps}
      >
        {children}
      </Text>
    );
  }
});
